// pages/user/auth.js
import { User } from "../../model/user";

Page({

  /**
   * 页面的初始数据
   */
  data: {
    userInfo: null,
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    wx.showLoading({
      title: '加载中',
    });
    this.getUserInfo();
  },
  /**
   * 获取用户信息
   */
  async getUserInfo() {
    const res = await User.getUserInfo();
    this.setData({
      userInfo: res
    });
    wx.hideLoading();
  },
  openUserAuth() {
    wx.navigateTo({
      url: 'user_auth',
    });
  },
  openPhoneAuth() {
    wx.navigateTo({
      url: 'phone_auth',
    });
  },
  openXlAuth() {
    wx.navigateTo({
      url: 'xl_auth',
    });
  },
  openJobAuth() {
    wx.navigateTo({
      url: 'job_auth',
    });
  },
  openSrAuth() {
    wx.navigateTo({
      url: 'sr_auth',
    });
  },
  openZcAuth() {
    wx.navigateTo({
      url: 'zc_auth',
    });
  },
})